package org.nstack.header.volume;

import org.nstack.header.message.APICreateMessage;
import org.nstack.header.message.APIParam;
import org.nstack.header.storage.primary.PrimaryStorageVO;
import org.springframework.http.HttpMethod;
import org.nstack.header.configuration.DiskOfferingVO;
import org.nstack.header.identity.Action;
import org.nstack.header.rest.RestRequest;
import org.nstack.header.tag.TagResourceType;


@Action(category = VolumeConstant.ACTION_CATEGORY)
@TagResourceType(VolumeVO.class)
@RestRequest(
        path = "/volumes/data",
        method = HttpMethod.POST,
        parameterName = "params",
        responseClass = APICreateDataVolumeEvent.class
)
public class APICreateDataVolumeMsg extends APICreateMessage {

    @APIParam(maxLength = 255)
    private String name;

    @APIParam(required = false, maxLength = 2048)
    private String description;

    @APIParam(resourceType = DiskOfferingVO.class, checkAccount = true)
    private String diskOfferingUuid;

    @APIParam(required = false, resourceType = PrimaryStorageVO.class)
    private String primaryStorageUuid;

    public String getPrimaryStorageUuid() {
        return primaryStorageUuid;
    }

    public void setPrimaryStorageUuid(String primaryStorageUuid) {
        this.primaryStorageUuid = primaryStorageUuid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getDiskOfferingUuid() {
        return diskOfferingUuid;
    }

    public void setDiskOfferingUuid(String diskOfferingUuid) {
        this.diskOfferingUuid = diskOfferingUuid;
    }
 
    public static APICreateDataVolumeMsg __example__() {
        APICreateDataVolumeMsg msg = new APICreateDataVolumeMsg();
        msg.setResourceUuid(uuid());
        msg.setDescription("test-data-volume");
        msg.setDiskOfferingUuid(uuid());
        msg.setPrimaryStorageUuid(uuid());
        msg.setName("test-volume");

        return msg;
    }

}
